package com.fiona.remoting.netty;

import java.net.InetSocketAddress;

import com.fiona.common.exception.RemotingException;
import com.fiona.remoting.api.Client;
import com.fiona.remoting.api.Server;
import com.fiona.remoting.api.Transporter;
import com.fiona.remoting.netty.client.NettyClient;
import com.fiona.remoting.netty.server.NettyServer;

public class NettyTransporter implements Transporter {

    public static final String NAME = "netty";

    @Override
    public Server bind(InetSocketAddress address) throws RemotingException {
        return new NettyServer(address);
    }

    @Override
    public Client connect(InetSocketAddress address) throws RemotingException {
        return new NettyClient(address);
    }

}
